<?php
namespace app\admin\controller;
use think\Request;
use think\Controller;
use app\common\controller\AdminBase;
//后台首页
class Index extends AdminBase{
    public function index()
    {
    	//栏目列表
    	//所有的顶级栏目
        $cate=db('category')->where('pid','=',0)->select();
	   	$this->assign('cate',$cate);
	  
	   	//所有的自己
	   	 $cateSon=db('category')->order('sort asc')->where('pid','>',0)->select();
	   	 $this->assign('son',$cateSon);
 	     // halt($cateSon);
       return $this->fetch();
    }
    
     public function welcome()
    {
      $info=db('users')->where('username',session('admin.username'))->find();
    	$this->assign('info',$info);
       return $this->fetch();
    }
    
   
   
}
